﻿#include <Sys\RenderUnit\SysRenderDatagram\GROUPRD.HPP>
#include <Render\Render_Win32\Render_Win32_D3D\RENDER_WIN32_D3D9.HPP>
#include <Sys\RenderUnit\SYSDDCLASSID.HPP>

using namespace CxxlMan;
using namespace Cxxl3D;


class CGroupDDD3D:public IDatagramDisposal_D3d9, public IGroupBridge
{
  virtual bool cxxlFASTCALL Exec(const Smart_Ptr<IRenderDatagramDisposalCenterD3d> &IRenderDatagramDisposalCenter_Arg,
    const Smart_Ptr<IRenderDatagram> &IRenderDatagram_Arg, LPDIRECT3DDEVICE9 pDEVICE9)
  {
    Smart_Ptr<IGroupRD> IGroupRD_Ptr = (IGroupRD*)GetDefaultInterface(IRenderDatagram_Arg);
    Smart_Ptr<cxxlList<IRenderDatagram> > IRenderDatagram_List = GetList(IGroupRD_Ptr);

    unsigned long Count = IRenderDatagram_List->GetCount();
    IRenderDatagram_List->ResetPT(toHead);
    for(Smart_Ptr<IRenderDatagram> IRenderDatagram_Ptr = (*IRenderDatagram_List)++; Count; --Count, IRenderDatagram_Ptr = (*IRenderDatagram_List)++)
      if( IRenderDatagramDisposalCenter_Arg->Exec(IRenderDatagram_Ptr,pDEVICE9) == false)
        return false;

    return true;

  }
public:

  // Constructor
  CGroupDDD3D()
    :cxxlObject(Spirit_Easy)
  {
  }

  // Destructor
  virtual ~CGroupDDD3D()
  {
  }

};

cxxlObject *cxxlFASTCALL New_CGroupDD_D3D9()
{
  return new CGroupDDD3D;
}